package com.itheima.array;

/**
 * @author jiangxun
 * @date 11-14-2024
 */
public class ArrayDemo01 {
    public static void main(String[] args) {
        // 声明一个二维数组
        int[][] twoDimensionalArray = new int[3][3];

        // 初始化二维数组
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                twoDimensionalArray[i][j] = i * 3 + j + 1;
            }
        }

        // 打印二维数组
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(twoDimensionalArray[i][j] + " ");
            }
            System.out.println();
        }
    }
}
